public class Dog extends Animal{
    public void bark(){
        System.out.println(name+ ":汪汪汪");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        //dog类中并没定义任何成员变量,name和age属性是从父类Animal中继承下来的
        System.out.println(dog.name);
        System.out.println(dog.age);

        //继承父类的eat()与sleep()
        dog.eat();
        dog.sleep();
        dog.bark();
    }
}
